home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 35 / q35.d81 / t.control80-c v3 < prev    next >
Text File  |  2022-08-28  |  19KB  |  396 lines

  1.  
  2.  
  3.                         C O N T R O L 8 0 - C   V 3
  4.  
  5.                       Original Program by Jon Mattson
  6.  
  7.              Modifications and Additional Text by Bob Markland
  8.  
  9.  
  10.     CONTROL80-C is a specialized version of Jon Mattson's excellent BASIC
  11. extension. Specifically, it contains all the tools necessary to easily
  12. program a fast and professional looking card game.
  13.  
  14.     Fender and I have both published card games using the original
  15. CONTROL80-C. However, as good as the program is, it left us wanting in two
  16. respects: The cards lacked borders, and when fanned or overlapped, tended
  17. to blend into one another. There was also no card back (you may have
  18. noticed on earlier games that the joker was substituted).
  19.  
  20.      For his Sixpack O' Solitaires Fender used BASIC to apply borders to
  21. the cards and I used a BASIC subroutine to display card backs on 128
  22. Cribbage. However, both of these approaches added extra code and caused
  23. noticeable slow-downs. And, while Jon Mattson would be the logical person
  24. to upgrade CONTROL80, unfortunately he has moved on to other things.
  25.  
  26.      The solution required generating a new source code, modifying the CARD
  27. function, and altering the built-in font; though very little has changed
  28. for CONTROL80-C users. For your convenience, I am including the entire text
  29. from the original CONTROL80-C. For those who have used the earlier versions
  30. there are only four major differences:
  31.  
  32.  (1)  When you use FCOPY to move the built-in font to the VDC chip, the
  33.       syntax is now FCOPY 7168,0,1.
  34.  
  35.  (2)  Because card games are not text intensive, fewer text characters
  36.       are available in the built-in font. Uppercase A-Z (in place of
  37.       the lowercase characters), 1-0, and most of the symbols such as !,
  38.       #, $, %, etc. remain in the Upper/Lowercase Font. However, we
  39.       recommend that you FCOPY a custom font of your own into the
  40.       Uppercase/Graphics font for your text, boxes, and effects.
  41.  
  42.  (3)  The cards from Ace of Clubs through King of Diamonds are
  43.       specified in the CARD command as 0-51, as before. You are
  44.       limited to 4 different Jokers, numbered 52-55 (in reality, if you
  45.       are using your own routines to shuffle, 56-65 will also display
  46.       Jokers, but the SHUF command will only handle four, 52-55).
  47.  
  48.  (4)  Now, use 66 to display a card back.
  49.  
  50.     CONTROL80-C does not support the following original Control80 commands:
  51. DUMP, HOME, LCLEAR, VSAVE and MINE. On the other hand, Jon added three new
  52. commands -- CARD, DICE and SHUF, and FILL was improved.
  53.  
  54.     I've put a small "demo" program on the issue as a Run It for
  55. CONTROL80-C V3. It shows you how fast the CARD command is, then returns to
  56. to LOADSTAR 128.
  57.  
  58.     First, a quick overview is in order for those who have no idea what
  59. Control80 and its close cousin, C80-C, are all about. Control80 is an
  60. extension of the BASIC 7.0 which adds many new keywords to the language.
  61. These new functions and commands are specifically designed to make using
  62. the 80-column screen easier. Those who have tried to work with 80-columns
  63. in BASIC 7.0 will realize just what a boon this is: you can't even PEEK or
  64. POKE to the VDC with normal BASIC! Control80 solves that problem and many
  65. others, as well.
  66.  
  67.      Using C80-C is simple. First, set aside a section of memory to hold it
  68. by opening up the area normally used for hires graphics. GRAPHIC1,1 will
  69. accomplish this, although it should be followed by GRAPHIC0,1 to get out of
  70. hires mode and GRAPHIC5 to return the screen editor controls to the 80-
  71. column screen. Then, just BLOAD C80-C into memory and SYS 4864, either in
  72. direct mode or early on in your program. Generally a simple BLOAD will
  73. suffice, but, if you have been playing around with BANKs and the like, you
  74. might want to use the full syntax. To summarize:
  75.  
  76.      GRAPHIC1,1:GRAPHIC0,1:GRAPHIC5:BLOAD"C80-C.V3",B0,P4864:SYS4864
  77.  
  78.      Unlike Control80, C80-C comes with a built-in, card-oriented font,
  79. which can be moved to VDC memory with a simple FCOPY 7168,0,1. (Note this
  80. address change from the earlier versions.) This command will cause the new
  81. font to replace the existing alternate (upper/lower case) font, so that you
  82. can use the CARD command. Once the font is in place, you can freely
  83. overwrite the area it previously occupied and even 'collapse' the graphic
  84. area with GRAPHICCLR to free up more program space if you wish, since C80-
  85. C, itself, resides below this area. As an aside, this is why you must open
  86. a graphics area for C80-C, whereas you do not need to do so with Control80.
  87. For obvious reasons, the FCOPY should come very shortly after the set-up
  88. commands previously mentioned; however, it should not be on the same line
  89. as those commands. The reason for this is that the computer deciphers
  90. keywords a line at a time, and, until the SYS 4864 has actually been acted
  91. upon, the FCOPY command will be translated as gibberish, resulting in a
  92. syntax error when that point in the line is reached.
  93.  
  94.      Once C80-C is installed, the new keywords can be used just like any
  95. other BASIC commands. You can even abbreviate them by shifting the second
  96. letter, as usual. Remember that C80-C must be active (not just resident)
  97. while you type in a program using its keywords, or they will not be
  98. tokenized correctly. Note, also, that C80-C uses memory from 4864 to 7167
  99. (once the font has been moved), so avoid POKEing around this area.
  100.  
  101.  FENDER'S NOTE: Since many, if not most, card solitaire games are easier to
  102. play with a mouse than with keyboard, Maurice Randall's MOUSE80 (from LS
  103. 128 #24) is recommended along with CONTROL80-C V3. The version you need is
  104. "mouse80.2400" which uses $2400 (or 9216) as its load address. Bob has
  105. supplied the file "mouse80.2400", as well as the two routines merged
  106. together in the file "c80c.v3-mou.2400".
  107.  
  108.      Hitting the beloved STOP/RESTORE combination will not deactivate
  109. C80-C. The QUIT command (previously unimplemented on the 128) will turn it
  110. off, although SYS 4864 will bring it back to life. Resetting the computer
  111. will also turn it off; however, due to its location, C80-C will still be
  112. resident for later use, as long as you haven't POKEd over its memory space.
  113. In this case, however, the font will likely be lost.
  114.  
  115.      Now let's look at your new resources. Certain conventions have been
  116. followed in this listing. Memory addresses are 0-65535, as usual, to allow
  117. use with both 16K and 64K VDCs. Note, however, that addresses above 16383
  118. wrap around on the 16K chip, i.e. 16384 = 0. Remember that the basic 8563
  119. chip is set up as follows:
  120.  
  121.      $0000 - 07FF        0 - 2047     Screen
  122.      $0800 - 0FFF     2048 - 4095     Attributes
  123.      $1000 - 1FFF     4096 - 8191     Unused
  124.      $2000 - 2FFF     8192 - 12287    Upper Case/Graphic (normal) Font
  125.      $3000 - 3FFF    12288 - 16383    Upper/Lower Case (alternate) Font
  126.  
  127.       VDC register numbers (reg# below) range from 0-36. It is not within
  128. the scope of this article to explain the use of every register, but a
  129. complete description can be found in the C-128 Programmer's Reference
  130. Guide. When in doubt, experiment with the WVD command, but be sure that you
  131. check the register's normal value first with the RVD function to return
  132. things to normal!
  133.  
  134.  
  135.                             ***  FUNCTIONS  ***
  136.  
  137.  PEER (VDC address)
  138.  ------------------
  139.  
  140.      This function allows you to check the contents of VDC memory. It
  141. operates just like BASIC's PEEK. For example, to find the character in the
  142. top left corner of the screen, PRINT PEER(0). Note that PEER is the
  143. counterpart of POST, below.
  144.  
  145.  
  146.  RVD (reg#)
  147.  ----------
  148.  
  149.      This function (Read ViDeo register) allows you to check the contents
  150. of any of the 37 VDC registers. For example, A=RVD(12) would put the
  151. contents of register 12 into the variable A. Note that RVD is the
  152. counterpart of WVD, below.
  153.  
  154.  
  155.                              ***  COMMANDS  ***
  156.  
  157.  BLOCK VDC address, number, value
  158.  --------------------------------
  159.  
  160.      This command allows you to fill any small section of VDC memory with a
  161. single value. "Address" indicates the starting position of the fill, and
  162. "number" (2-255) indicates how many consecutive locations to fill with the
  163. specified "value" (0-255), from that point on. One of the best uses of
  164. BLOCK